package com.sjsu.load;

import com.sjsu.aws.groupmembership.GroupMemberShip;
import com.sjsu.aws.groupmembership.GroupMembershipService;
import com.sjsu.aws.groupmembership.GroupMembershipServiceImpl;

public class ConcurrentCall extends Thread {
	int	                   testCaseId;
	int	                   currentTestIteration;
	GroupMembershipService	groupMembershipServiceImpl;
	
	/**
	 * 
	 * @param testCaseId
	 * @param currentTestIteration
	 *            This constructor used for testAddUser and testValidateUser
	 */
	public ConcurrentCall(int testCaseId, int currentTestIteration, GroupMembershipService	groupMembershipServiceImpl) {
		this.testCaseId = testCaseId;
		this.currentTestIteration = currentTestIteration;
		this.groupMembershipServiceImpl = groupMembershipServiceImpl;
	}
	
	public void run() {
		/*System.out.println("Running testcaseId=" + testCaseId
		        + " currentTestIteration=" + currentTestIteration);
		switch (testCaseId) {
			case 1: // Create group
				try {
					GroupMemberShip g = new GroupMemberShip();
					g.setGroupId("id"+currentTestIteration);
					g.setGroupName("name"+currentTestIteration);
					g.setMemberId("name"+currentTestIteration);
					groupMembershipServiceImpl.createGroup(g);
					
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				break;
			case 2: // add member to group
				try {
					GroupMemberShip g = new GroupMemberShip();
					g.setGroupId("id"+currentTestIteration);
					g.setGroupName("name"+currentTestIteration);
					g.setMemberId("name"+currentTestIteration);
					groupMembershipServiceImpl.createGroup(g);
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				break;
		}*/
		// System.out.println("Completed testcaseId="+testCaseId 
		// +" currentTestIteration="+currentTestIteration);
	}
	
}
